package com.cainaer.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cainaer.product.domain.SystemAttribute;
import com.cainaer.product.mapper.SystemAttributeMapper;
import com.cainaer.product.service.ISystemAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统规格表 服务实现类
 * </p>
 *
 * @author Tina
 * @since 2020-09-11
 */
@Service
public class SystemAttributeServiceImpl extends ServiceImpl<SystemAttributeMapper, SystemAttribute> implements ISystemAttributeService {

    @Autowired
    private SystemAttributeMapper systemAttributeMapper;

    /**
     * 新增系统规格
     *
     * @param systemAttribute
     * @return
     */
    @Override
    public Integer insertTemAttribute(SystemAttribute systemAttribute) {
        return systemAttributeMapper.insert(systemAttribute);
    }

    /**
     * 编辑系统规格
     *
     * @param systemAttribute
     * @return
     */
    @Override
    public Integer editTemAttribute(SystemAttribute systemAttribute) {
        return systemAttributeMapper.updateById(systemAttribute);
    }

    /**
     * 查询商品规格
     *
     * @param systemAttribute
     * @return
     */
    @Override
    public List<SystemAttribute> selectSystemAttribute(SystemAttribute systemAttribute) {
        QueryWrapper queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("status",0);
        return systemAttributeMapper.selectList(queryWrapper);
    }
}
